package com.wx.mapper;

import com.wx.common.MyMapper;
import com.wx.entity.SysAuthority;
import com.wx.entity.SysRoleAuthority;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface SysRoleAuthorityMapper extends MyMapper<SysRoleAuthority> {

    /**
     * <p>Title:      batchDeleteByRoleId. </p>
     * <p>Description 根据角色删除权限信息</p>
     *
     * @param         roleId String
     * @return      int
     * @Author        <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since     2019/6/18 11:37
     */
    int batchDeleteByRoleId(String roleId);

    /**
     * <p>Title:      getAuthorityByRoleIds. </p>
     * <p>Description 根据角色查询权限信息</p>
     *
     * @param       roleIds  List<String>
     * @return        List
     * @Author        <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since     2019/6/18 11:36
     */
    List<SysAuthority> getAuthorityByRoleIds(@Param("roleIds") List<String> roleIds);

    /**
     * <p>Title:      selectRoleAuthorityByRoleId. </p>
     * <p>Description 根据角色查询权限信息</p>
     *
     * @param       roleId  List<String>
     * @return        List
     * @Author        <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since     2019/6/18 11:36
     */
    List<SysRoleAuthority> selectRoleAuthorityByRoleId(String roleId);

    /**
     * <p>Title:      getBindRoleListByActionId. </p>
     * <p>Description 获取权限字符串所绑定的角色</p>
     *
     * @param         actionId String
     * @return        List<String>
     * @Author        <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since     2019/9/27 16:26
     */
    List<String> getBindRoleListByActionId(String actionId);

    /**
     * <p>Title:      deleteByActionId. </p>
     * <p>Description 根据权限id删除绑定关系</p>
     *
     * @param         actionId String
     * @return        List<String>
     * @Author        <a href="xinglinglove1029@163.com"/>杨文生</a>
     * @since     2019/9/27 16:26
     */
    int deleteByActionId(String actionId);

    int batchInsert(@Param("list") List<SysRoleAuthority> roleAuthorities);


}